insert overwrite table jms_dm.dm_outfield_person_order_sum_dt partition(dt) 
--星级排名需求（业务员订单揽收情况）
select
        dt as date_time --业务日期
       ,pick_staff_code   --取件业务员编码
       ,max(pick_staff_name)as pick_staff_name --取件业务员名字
       ,sum(if(order_status_code=103,1,0)) as taking_success_sum  --揽收成功总量
       ,sum(if(order_status_code=104,1,0)) as order_taking_fail_sum  --揽收失败总量
       ,dt  --分区
from jms_dwd.dwd_yl_oms_oms_order_incre_dt
where dt='{{ execution_date | cst_ds }}'
group by dt,pick_staff_code
distribute by 10
;
